home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- // TURRET DYNAMIC DATA
-
- TurretData PlasmaTurret
- {
- maxDamage = 1.0;
- maxEnergy = 200;
- minGunEnergy = 75;
- maxGunEnergy = 6;
- reloadDelay = 0.8;
- fireSound = SoundPlasmaTurretFire;
- activationSound = SoundPlasmaTurretOn;
- deactivateSound = SoundPlasmaTurretOff;
- whirSound = SoundPlasmaTurretTurn;
- range = 100;
- dopplerVelocity = 0;
- castLOS = true;
- supression = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- visibleToSensor = true;
- debrisId = defaultDebrisMedium;
- className = "Turret";
- shapeFile = "hellfiregun";
- shieldShapeName = "shield_medium";
- speed = 2.0;
- speedModifier = 2.0;
- projectileType = FusionBolt;
- damageSkinData = "objectDamageSkins";
- shadowDetailMask = 8;
- explosionId = LargeShockwave;
- description = "Plasma Turret";
- };
-
- TurretData ELFTurret
- {
- maxDamage = 1.0;
- maxEnergy = 150;
- minGunEnergy = 50;
- maxGunEnergy = 5;
- range = 40;
- visibleToSensor = true;
- dopplerVelocity = 0;
- castLOS = true;
- supression = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- debrisId = defaultDebrisMedium;
- className = "ELF Turret";
- shapeFile = "chainturret";
- shieldShapeName = "shield";
- speed = 5.0;
- speedModifier = 1.5;
- projectileType = turretCharge;
- reloadDelay = 0.3;
- explosionId = LargeShockwave;
- description = "ELF Turret";
-
- fireSound = SoundGeneratorPower;
- activationSound = SoundChainTurretOn;
- deactivateSound = SoundChainTurretOff;
- damageSkinData = "objectDamageSkins";
- shadowDetailMask = 8;
-
- isSustained = true;
- firingTimeMS = 750;
- energyRate = 30.0;
- };
-
- TurretData RocketTurret
- {
- maxDamage = 0.75;
- maxEnergy = 100;
- minGunEnergy = 60;
- maxGunEnergy = 60;
- range = 150;
- gunRange = 300;
- visibleToSensor = true;
- dopplerVelocity = 0;
- castLOS = true;
- supression = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- debrisId = defaultDebrisLarge;
- className = "Turret";
- shapeFile = "missileturret";
- shieldShapeName = "shield_medium";
- speed = 2.0;
- speedModifier = 2.0;
- projectileType = TurretMissile;
- // reloadDelay = 3.5;
- fireSound = SoundMissileTurretFire;
- activationSound = SoundMissileTurretOn;
- deactivateSound = SoundMissileTurretOff;
- // whirSound = SoundMissileTurretTurn;
- damageSkinData = "objectDamageSkins";
- shadowDetailMask = 8;
- targetableFovRatio = 0.5;
- explosionId = LargeShockwave;
- description = "Rocket Turret";
- };
-
- function RocketTurret::onPower(%this,%power,%generator)
- {
- if (%power) {
- %this.shieldStrength = 0.03;
- GameBase::setRechargeRate(%this,14);
- }
- else {
- %this.shieldStrength = 0;
- GameBase::setRechargeRate(%this,0);
- Turret::checkOperator(%this);
- }
- GameBase::setActive(%this,%power);
- }
-
- function RocketTurret::verifyTarget(%this,%target)
- {
- if (GameBase::virtual(%target, "getHeatFactor") >= 0.5)
- return "True";
- else
- return "False";
- }
-
- //--------------------------------------------
-
- TurretData MortarTurret
- {
- maxDamage = 1.0;
- maxEnergy = 45;
- minGunEnergy = 45;
- maxGunEnergy = 100;
- reloadDelay = 2.0;
- fireSound = SoundMortarTurretFire;
- activationSound = SoundMortarTurretOn;
- deactivateSound = SoundMortarTurretOff;
- whirSound = SoundMortarTurretTurn;
- range = 0;
- dopplerVelocity = 0;
- castLOS = true;
- supression = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- visibleToSensor = true;
- debrisId = defaultDebrisMedium;
- className = "Turret";
- shapeFile = "mortar_turret";
- shieldShapeName = "shield_medium";
- speed = 2.0;
- speedModifier = 2.0;
- projectileType = MortarTurretShell;
- damageSkinData = "objectDamageSkins";
- shadowDetailMask = 8;
- explosionId = LargeShockwave;
- description = "Mortar Turret";
- };
-
- //--------------------------------------------
-
- TurretData IndoorTurret
- {
- className = "Turret";
- shapeFile = "indoorgun";
- projectileType = MiniFusionBolt;
- maxDamage = 2.5;
- maxEnergy = 60;
- minGunEnergy = 20;
- maxGunEnergy = 6;
- reloadDelay = 0.4;
- speed = 5.0;
- speedModifier = 1.0;
- range = 25;
- visibleToSensor = true;
- dopplerVelocity = 2;
- castLOS = true;
- supression = false;
- supressable = false;
- pinger = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- debrisId = defaultDebrisMedium;
- shieldShapeName = "shield";
- fireSound = SoundEnergyTurretFire;
- activationSound = SoundEnergyTurretOn;
- deactivateSound = SoundEnergyTurretOff;
- damageSkinData = "objectDamageSkins";
- shadowDetailMask = 8;
- explosionId = debrisExpMedium;
- description = "Indoor Turret";
-
- };
-
-
- //--------------------------------------------
-
- TurretData DeployableTurret
- {
- className = "Turret";
- shapeFile = "remoteturret";
- projectileType = MiniFusionBolt;
- maxDamage = 0.65;
- maxEnergy = 60;
- minGunEnergy = 6;
- maxGunEnergy = 5;
- sequenceSound[0] = { "deploy", SoundActivateMotionSensor };
- reloadDelay = 0.4;
- speed = 4.0;
- speedModifier = 1.5;
- range = 30;
- visibleToSensor = true;
- shadowDetailMask = 4;
- dopplerVelocity = 0;
- castLOS = true;
- supression = false;
- mapFilter = 2;
- mapIcon = "M_turret";
- debrisId = flashDebrisMedium;
- shieldShapeName = "shield";
- fireSound = SoundRemoteTurretFire;
- activationSound = SoundRemoteTurretOn;
- deactivateSound = SoundRemoteTurretOff;
- explosionId = flashExpMedium;
- description = "Remote Turret";
- damageSkinData = "objectDamageSkins";
- };
-
- function DeployableTurret::onAdd(%this)
- {
- schedule("DeployableTurret::deploy(" @ %this @ ");",1,%this);
- GameBase::setRechargeRate(%this,5);
- %this.shieldStrength = 0;
- if (GameBase::getMapName(%this) == "") {
- GameBase::setMapName (%this, "Remote Turret");
- }
- }
-
- function DeployableTurret::deploy(%this)
- {
- GameBase::playSequence(%this,1,"deploy");
- }
-
- function DeployableTurret::onEndSequence(%this,%thread)
- {
- GameBase::setActive(%this,true);
- }
-
- function DeployableTurret::onDestroyed(%this)
- {
- Turret::onDestroyed(%this);
- $TeamItemCount[GameBase::getTeam(%this) @ "TurretPack"]--;
- }
-
- // Override base class just in case.
- function DeployableTurret::onPower(%this,%power,%generator) {}
- function DeployableTurret::onEnabled(%this)
- {
- GameBase::setRechargeRate(%this,5);
- GameBase::setActive(%this,true);
- }
-
-
- //--------------------------------------------
-
- TurretData CameraTurret
- {
- className = "Turret";
- shapeFile = "camera";
- maxDamage = 0.25;
- maxEnergy = 10;
- speed = 20;
- speedModifier = 1.0;
- range = 50;
- sequenceSound[0] = { "deploy", SoundActivateMotionSensor };
- visibleToSensor = true;
- shadowDetailMask = 4;
- castLOS = true;
- supression = false;
- supressable = false;
- mapFilter = 2;
- mapIcon = "M_camera";
- debrisId = defaultDebrisSmall;
- FOV = 0.707;
- pinger = false;
- explosionId = debrisExpMedium;
- description = "Camera";
- };
-
- function CameraTurret::onAdd(%this)
- {
- schedule("CameraTurret::deploy(" @ %this @ ");",1,%this);
- if (GameBase::getMapName(%this) == "") {
- GameBase::setMapName (%this, "Camera");
- }
- }
-
- function CameraTurret::deploy(%this)
- {
- GameBase::playSequence(%this,1,"deploy");
- }
-
- function CameraTurret::onEndSequence(%this,%thread)
- {
- GameBase::setActive(%this,true);
- }
-
- function CameraTurret::onDestroyed(%this)
- {
- Turret::onDestroyed(%this);
- $TeamItemCount[GameBase::getTeam(%this) @ "CameraPack"]--;
- }
-
-
- //---------------------------------------------------
-
- function Turret::onAdd(%this)
- {
- if (GameBase::getMapName(%this) == "") {
- GameBase::setMapName (%this, "Turret");
- }
- }
-
- function Turret::onActivate(%this)
- {
- GameBase::playSequence(%this,0,power);
- }
-
- function Turret::onDeactivate(%this)
- {
- GameBase::stopSequence(%this,0);
- Turret::checkOperator(%this);
- }
-
- function Turret::onSetTeam(%this,%oldTeam)
- {
- if(GameBase::getTeam(%this) != Client::getTeam(GameBase::getControlClient(%this)))
- Turret::checkOperator(%this);
-
- }
-
- function Turret::checkOperator(%this)
- {
- %cl = GameBase::getControlClient(%this);
- if(%cl != -1) {
- %pl = Client::getOwnedObject(%cl);
- Player::setMountObject(%pl, -1,0);
- Client::setControlObject(%cl, %pl);
- }
- Client::setGuiMode(%cl,2);
- }
-
- function Turret::onPower(%this,%power,%generator)
- {
- if (%power) {
- %this.shieldStrength = 0.03;
- GameBase::setRechargeRate(%this,10);
- }
- else {
- %this.shieldStrength = 0;
- GameBase::setRechargeRate(%this,0);
- Turret::checkOperator(%this);
- }
- GameBase::setActive(%this,%power);
- }
-
- function Turret::onEnabled(%this)
- {
- if (GameBase::isPowered(%this)) {
- %this.shieldStrength = 0.03;
- GameBase::setRechargeRate(%this,10);
- GameBase::setActive(%this,true);
- }
- }
-
- function Turret::onDisabled(%this)
- {
- %this.shieldStrength = 0;
- GameBase::setRechargeRate(%this,0);
- Turret::onDeactivate(%this);
- }
-
- function Turret::onDestroyed(%this)
- {
- StaticShape::objectiveDestroyed(%this);
- %this.shieldStrength = 0;
- GameBase::setRechargeRate(%this,0);
- Turret::onDeactivate(%this);
- Turret::objectiveDestroyed(%this);
- calcRadiusDamage(%this, $DebrisDamageType, 2.5, 0.05, 25, 9, 3, 0.40,
- 0.1, 200, 100);
- }
-
- function Turret::onDamage(%this,%type,%value,%pos,%vec,%mom,%object)
- {
- if(%this.objectiveLine)
- %this.lastDamageTeam = GameBase::getTeam(%object);
- %TDS= 1;
- if(GameBase::getTeam(%this) == GameBase::getTeam(%object)) {
- %name = GameBase::getDataName(%this);
- if(%name != DeployableTurret && %name != CameraTurret )
- %TDS = $Server::TeamDamageScale;
- }
- StaticShape::shieldDamage(%this,%type,%value * %TDS,%pos,%vec,%mom,%object);
- }
-
- function Turret::onControl (%this, %object)
- {
- %client = Player::getClient(%object);
- Client::sendMessage(%client,0,"Controlling turret " @ %this);
- }
-
- function Turret::onDismount (%this, %object)
- {
- %client = Player::getClient(%object);
- Client::sendMessage(%client,0,"Leaving turret " @ %this);
- }
-
- //function Turret::onCollision (%this, %object)
- //{
- // if (getObjectType (%object) == "Player")
- // {
- // Player::mountObject (%object, %this);
- // }
- //}
-